#ifndef CLICKBUTTON_H
#define CLICKBUTTON_H

#include <QDebug>
#include <QSound>
#include <QWidget>
#include <QPixmap>
#include <QPushButton>
#include <QPropertyAnimation>

class ClickButton : public QPushButton
{
    Q_OBJECT
public:
    explicit ClickButton(QString normal_image_pathname, QString pressed_image_pathname, QString sound_pathname);

    ~ClickButton();

signals:

private:
    // 按钮的音效
    QSound *sound;

    // 按钮的图片
    QString normal_image_pathname;

    // 按钮点击时的图片·
    QString pressed_image_pathname;


private:
    // 鼠标按下事件
    void mousePressEvent(QMouseEvent *) override;

    // 鼠标释放事件
    void mouseReleaseEvent(QMouseEvent *) override;

private:
    // 设置按钮图片
    void setButtonImage(QString image_pathname);
};

#endif // CLICKBUTTON_H
